<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <script>
    
		var str = "i love javascript very much";
	
		var arr = str.split(" ");
		
		for (var i = 0 ; i < arr.length ; i++) {
			
			arr[i] = arr[i].charAt(0).toUpperCase() + arr[i].slice(1);
		}
	
		str = arr.join(" ");
		console.log(str);
  </script>
</head>
<body>
  
</body>
</html>